package app.netant.galgame.yuinya;

import org.jsoup.select.Elements;

import cn.lily.com.file.excel.io.ExcelWriter;
import app.netant.NetAntBase;

public class YuiNyaNetAntDetail extends NetAntBase {

	public YuiNyaNetAntDetail(String netSite) {
		super(netSite);
	}
	
	public void analyse(){
		
		Elements activePart = document.select("body .container .content-wrap .content article.excerpt.excerpt-one header a");
		if(activePart.size()>0){	
			for(int i=0;i<activePart.size();i++){
				System.out.println(activePart.get(i).text());
				System.out.println(activePart.get(i).attr("href"));
			}
		}
		
	}
	
	public int analyse(ExcelWriter ew,int index){
		
		Elements activePart = document.select("body .container .content-wrap .content article.excerpt.excerpt-one header a");
		if(activePart.size()>0){	
			for(int i=0;i<activePart.size();i++){
				
				ew.locateRow(index);
				ew.setCellValue(0,activePart.get(i).text());
				ew.setCellValue(1,activePart.get(i).attr("href"));
				
				index ++ ;
			}
		}
		
		return index;
		
	}
	
	public static void main(String[] args) {
		
		YuiNyaNetAntDetail ant = new YuiNyaNetAntDetail("http://yui-nya.com/category/games/cn");
		ant.analyse();
		
	}

}
